home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
015a
/
vaxutils.zip
/
CD.COM
next >
Wrap
Text File
|
1987-07-24
|
2KB
|
76 lines
$! CD.COM changes the VMS prompt to show node and directory
$!
$! This procedure was transcribed from the Languages & Tools section of the
$! July, 1987, DECUS SIGs Newsletter. It was modified slightly by Frank
$! Mallory; the node and device display were commented out, so that it gives
$! a prompt consisting only of the directory.
$!
$! To invoke CD, put the following commands or equivalent in your LOGIN.COM:
$! CD== "@RSC_USERS:[MALLORY]CD.COM"
$! COMM== "@RSC_USERS:[MALLORY]CD RSC_USERS:[MALLORY.COMM]" ! For each
$! logical that is used to set a new default directory (replaces SET DEF)
$! CD [MALLORY]
$!
$
$ V = F$verify(0)
$ If P1 .nes. "" then SET DEFAULT 'P1'
$
$ ESC[0,8] = 27
$ Bold_on = ESC + "[1m"
$ Bold_off = ESC + "[0m"
$ First_part = ""
$ Max_length = 23
$! Node = F$Getsyi("NODENAME")
$! Device = F$Trnlmn("SYS$DISK")
$!
$!CHECK:
$! If F$length("''device'") .LT. 6 then GOTO CONCAT
$!
$! Place = F$locate("$", device)
$! If Place .EQ. F$length(Device) then GOTO NEXT
$! Temp = F$extract(Place + 1, F$length(device),device);
$!
$!UP_THERE:
$! If F$length("''temp'") .GT. 6 then GOTO THERE
$!
$! Device = Temp
$! GOTO CONCAT
$!
$!THERE:
$! Place = F$locate("$", temp)
$! If Place .EQ. F$length(temp) then GOTO NEXT
$!
$! Temp = F$extract(Place + 1, F$length(temp),temp)
$! GOTO UP_THERE
$!
$!NEXT:
$! Device = F$extract(0, f$locate(":", device),device)
$! Device = F$trnlmn("''device'")
$! GOTO CHECK
$!
$!CONCAT:
$! First_part = Node + "::"''device'"
$ Cur_dir = First_part + F$directory()
$ If F$length(Cur_dir) .LE. Max_length then GOTO CHANGE_PROMPT
$
$ Abbrev_dir = Cur_dir
$ Abv_Length = 'Max_length' - 'F$length(First_part)' - 4
$
$ FIND_PERIOD:
$ Period = F$locate(".", Abbrev_dir)
$ If Period .EQ. F$length(Abbrev_dir) then GOTO ABBREV_PROMPT
$
$ Abbrev_dir = F$extract(Period + 1, -
F$length(Abbrev_dir) - 1, -
Apprev_dir)
$ If F$length(Abbrev_dir) .GT. 'Abv_length' then GOTO FIND_PERIOD
$
$ ABBREV_PROMPT:
$ If 'F$length(Abbrev_dir)' .GT. 'Abv_length' then -
Abbrev_dir = F$extract(0, Abbrev_length - 1, Abbrev_dir) + "]"
$ Cur_dir = First_part + "[..." + "'Abbrev_dir'"
$
$ CHANGE_PROMPT:
$ Set Prompt = "''Bold_on'''Cur_dir'$''Bold_off'"
$ V = F$verify(V)